#!/bin/sh
#
# PROVIDE: peerbanhelper
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="peerbanhelper"
rcvar=peerbanhelper_enable


: ${peerbanhelper_enable:=NO}
: ${peerbanhelper_user:="root"}
: ${peerbanhelper_dir:="/usr/local/var/db/peerbanhelper"}
: ${peerbanhelper_classpath:="/usr/local/lib/peerbanhelper/PeerBanHelper.jar"}
: ${peerbanhelper_jvm_flags:="-Dpbh.release=freebsd -Dpbh.datadir=${peerbanhelper_dir} -Xmx512M -Xss512K -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps"}
: ${peerbanhelper_command:="/usr/local/bin/java ${peerbanhelper_jvm_flags} -jar ${peerbanhelper_classpath}"}

command="/usr/sbin/daemon"
command_args="-f -p /var/run/${name}.pid -u ${peerbanhelper_user} ${peerbanhelper_command}"

load_rc_config $name
run_rc_command "$1"
